/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.edu.pucp.dp1.lectura.controlador;

import java.util.ArrayList;
//import pe.edu.pucp.dp1.lectura.modelo.ObjCar;
import Shared.ObjCar;

/**
 *
 * @author ed
 */
public class HiloVisualizarCar extends Thread{
    GestorCar gestorCar = GestorCar.getInstance();
    int seg=0;
    public void run(){
        try{
            while(true)
            {
                Thread.sleep(1000);                
                ArrayList<ObjCar> listCarSimu = this.gestorCar.getListCarSimu();
                int numCar = listCarSimu.size();
                System.out.println("Segundo:\t"+seg+"\t"+numCar);
                for(int i=0;i<numCar;i++)
                {
                    ObjCar carrito=listCarSimu.get(i);
                    System.out.println("\tCar: "+carrito.getPlaca()+" ["+carrito.getPosX()+","+carrito.getPosY()+"]");
                }
                seg++;
            }
        }catch(Exception e){}
        
    }
    
}
